<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=2.0, user-scalable=no"/>
<title>浙江日报报卡激活</title>
<link href="/Public/css/zjcard/zjdailycard.css" type="text/css" rel="stylesheet" />
<!-- <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css"> -->
<link href="/Public/css/bootstrap/bootstrap.min.css" rel="stylesheet">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<!--<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script> -->
<script src="/Public/js/user/jquery.min.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<!--<script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> -->
<script src="/Public/js/user/bootstrap.min.js"></script>
<link href="/Public/css/zjcard/common.css" type="text/css" rel="stylesheet" />
</head>

<body style="background-color:#f7f7f9">
<div class="container-fluid">
    <div class="row">
        <div class="col-md-6 col-md-offset-3">
            <div class="bannerTop" style="margin-left:-400px;"></div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <div class="jumbotron margin-vertical card">
                    <div class="row">
                        <for start="0" end="count($address)"> 
                        <div class="col-md-4">
                            <div class="row card-block"> 
                                <input type="hidden" value="{$address[$i]['id']}" class="addr_id" name="addr_id">
                                <div class="col-md-9">
                                    <h4 class="card-title">{$address[$i]['username']}</h4>
                                    <div class="divider"></div>
                                    <p class="card-content">地址：{$address[$i]['address']}</p>
                                </div>
                                <div class="col-md-3">
                                    <img src="/Public/images/information60.png" class="card-info" style="display:none"/>
                                </div>
                            </div>
                        </div>
                        </for>
                    </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-1 col-md-offset-8">
            <a type="button" class="btn btn-primary pull-right" href="{:U('Wap/ZJDailyCard/index')}">返回</a>
        </div>
        <div class="col-md-1">
            <a type="button" class="btn btn-primary pull-right" href="{:U('Wap/CustomerAddr/edit')}">新增地址</a>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="/Public/js/zjdailyCard/page.zjdailyCard.js"></script>
<script type="text/javascript">
(function(){
    var selected = page.zjdailyCard.cookie.getItem( "addr_id" );
    selected && $( "input[value="+ selected +"]" ).parent().find( "img.card-info" ).css( "display", "" );
})();
$( ".card-block" ).unbind( "click" ).bind( "click", function(){
        var selected = page.zjdailyCard.cookie.getItem( "addr_id" );
        var stored = page.zjdailyCard.cookie.storeItem( "addr_id", $(this).find("input.addr_id").val() );
        selected && $( "input[value="+ selected +"]" ).parent().find( "img.card-info" ).css( "display", "none" );
        stored && $( "input[value="+ stored +"]" ).parent().find( "img.card-info" ).css( "display", "" );
})
</script>
</html>
